# -*- coding: utf-8 -*-
###################################################
#    This file is part of blockIMH.
#
#    blockIMH is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    blockIMH is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with blockIMH.  If not, see <http://www.gnu.org/licenses/>.
###################################################
#! /usr/bin/env python

import pat  # touch pat.py in the cwd and try to import the empty file under Linux
import string 
import os,sys

# This function is only used to get the path to
# the folder where these files are, it has
# nothing to do with block IMH.

################## os.getcwd()##############
def get_path():
    PAT = str(pat).replace("<module 'pat' from ", "")[1:-9]
    #PAT=str(pat).split()[3][1:-9] # PATH extracted..
    sig=None
    try:
        sig=os.remove(os.path.join(PAT,'pat.pyc'))# get_rid...
    except OSError:
        pass
#        PAT=PAT +'/'
#        sig=os.remove(PAT + 'pat.pyc')# Fix for mutiple calls..  
    return PAT
###############################
#LOCATE=get_path()
#print LOCATE # 

